<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="//www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta charset="utf-8">
		<title>基本信息</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
		<script src="js/jquery-1.9.1.min.js"></script>
		<script src="js/jquery.easydropdown.js"></script>
		<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
		<link href="css/personal.css" rel="stylesheet" type="text/css" media="all" />
		<link href="//i2.hdfimg.com/space/css/css.css?1350483498" rel="stylesheet" type="text/css" />
		<script type="text/javascript" language="javascript" src="//i2.hdfimg.com/js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="//i2.hdfimg.com/passport/js/usercenter.ad622eeb.js"></script>
		<script type="text/javascript">
			var _czc = _czc || [];
			_czc.push(["_setAccount", "1256706712"]);
		</script>
	</head>

	<body>
		<script language="javascript">
			function checksub() {
				var patientName = $('#username').val();
				if(patientName == "") {
					alert("患者姓名不能为空");
					return false;
				}

				var patientIdCard = $("#IDcard").val();
				if(patientIdCard.length == 18) {
					var year = patientIdCard.substr(6, 4);
					var month = patientIdCard.substr(10, 2);
					var day = patientIdCard.substr(12, 2);
					if((NowYear < year || year < 1900) || (month > 12 || month == 0) || (day > 31 || day == 0)) {
						alert('输入的身份证号有误');
						return false;
					}
				} else if(patientIdCard.length == 15) {
					var year = '19' + patientIdCard.substr(6, 2);
					var month = patientIdCard.substr(8, 2);
					var day = patientIdCard.substr(10, 2);
					if((NowYear < year || year < 1900) || (month > 12 || month == 0) || (day > 31 || day == 0)) {
						alert('输入的身份证号有误');
						return false;
					}
				} else {
					alert('输入的身份证号位数有误！');
					return false;
				}

				var sex = $('input:radio[name="sex"]:checked').val();
				if(sex == null) {
					alert("患者性别不能为空");
					return false;
				}

				if(patientName.replace(/([\u4E00-\u9FA5\uf900-\ufa2d])/g, 'aa').length > 20) {
					alert("患者姓名不能超过20个字符");
					return false;
				}

				var birthday = $('#birthday').val();
				if(birthday == "") {
					alert("出生日期格式不正确, 正确日期格式如：1980-01-01");
					return false;
				}

				var mobile = $('#mobile').val();
				if(!isMatch(mobile, /^1[3456789][0-9]{9}$/)) {
					alert("手机格式不正确，正确手机格式如：13800138000");
					return false;
				}
				var smobile = mobile.substr(2, 9);
				var i, j;
				for(i = 0; i < 10; i++) {
					var flag = 0;
					for(j = 0; j < smobile.length; j++) {
						var num = smobile.substr(j, 1);
						if(num == i) flag++;
					}
					if(flag > 8) {
						alert("请输入真实手机号");
						return false;
					}
				}
			}
		</script>
		<!--
		---悬浮按钮
		
		<div id="dg" style="z-index: 9999; position: fixed ! important; right: 0px; top: 0px;">
			<table width="" 100% style="position: absolute; width:260px; right: 0px; top: 0px;">
				<input type="button" value="按钮"/>
			</table>
		</div>
		
		-->
		<!-- start header-->
		<div id="dg" style="z-index: 555; position: fixed ! important; right: 0px; top: 500px;">
			<table width="" 100% style="position: absolute; width:260px; right: 0px; top: 0px;">
				<a href="baseInfo.html"><img src="img/personal.png" /></a>
			</table>
		</div>

		<div class="header_bg">
			<div class="wrap">
				<div class="header">
					<div class="logo">
						<img src="img/logo-login.png" width="250px" height="90px" />

						<span class="login-head">
							<script>
								$(".login-head").load('front-top.html');
							</script>
						</span>
                </li>
					</div>

					<div class="header_right">
						<div class="search">
							<form>
								<input type="text" value="" placeholder="搜索...">
								<input type="submit" value="">
							</form>
						</div>

						<div class="clear"></div>
					</div>
				</div>
				<div class="header_menu">
					<div class="menu_box_list">
						<ul>
							<li class="color1">
								<a href="index.html"><i class="icon1"> </i><span>导航</span></a>
							</li>
							<li class="color2">
								<a href="medicalmall.html"> <i class="icon2"> </i> <span>商城</span></a>
							</li>
							<li class="color3">
								<a href="doctor.html"> <i class="icon3"> </i><span>医生</span></a>
							</li>
							<li class="color4">
								<a href="hospital.html"> <i class="icon4"> </i><span>医院</span></a>
							</li>
							<li class="color5">
								<a href="druggist.html"> <i class="icon5"> </i> <span>药商</span></a>
							</li>
							<li class="color6">
								<a href="contact.html"> <i class="icon6"> </i> <span>联系我们</span></a>
							</li>
						</ul>
						<div class="clear"></div>
					</div>
				</div>
			</div>
		</div>
		<!-- start top-->
		<div class="top_bg">
			<div class="wrap">
				<div class="top_grids1">
					<div class="top_grids_text">
						<h2>云&nbsp;上&nbsp;医&nbsp;疗&nbsp;欢&nbsp;迎&nbsp;您</h2>
					</div>
					<div class="top_map1">
						<ul>
							<li class="map"></li>
						</ul>
					</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>

		<!-- start content -->
		<div class="content_bg">
			<div class="wrap">
				<div class="content">
					<div class="content_text about">
						<h2>基本信息</h2>
					</div>
					<!-- start main_btm -->
					<div class="contact">
						<div id="">
							<span class="red">提示：</span>
						</div>
						<div>
							<p>1. 网站郑重承诺对您的个人信息保密，仅医患双方可见。</p>
							<p>2. 请您务必填写真实资料，医生才能给您准确的医疗服务。</p>
							<p>3. 一旦信息建立，将无法编辑或删除，请确认无误后提交。</p>
						</div>
						<br />
						<form action="/user/savepatient" method="post" onsubmit="return checksub();" name="memberform" id="memberform">
							<div>
								<span class="red">*</span> 患者姓名<input type="text" class="input-text" id="username" />
								<span class="gray">患者姓名不能为空</span>
							</div>
							<br />
							<div>
								<span class="red">*</span>身份证件
								<input type="text" class="input-text" id="IDcard" name="IDcard">
								<span class="gray">身份证号码</span>
							</div>
							<br />
							<div><span class="red">*</span>性别
								<input class="sex" type="radio" alt="性别:必选" value="1" name="sex" /> 男
								<input class="sex" type="radio" alt="性别:必选" value="0" name="sex" /> 女
								<label id="chk_sex"></label>&nbsp;&nbsp;&nbsp;&nbsp;<span class="red">*</span>出生日期
								<input type="text" class="input-text" name="birthday" placeholder="格式xxxx-xx-xx">
							</div>
							<br />
							<div>
								<span class="red">*</span> 手机
								<input maxlength="16" class="input-text" id="mobile" />
								<span class="gray">请确保手机填写正确,当咨询被大夫回复时,会有短信给您通知(免费)</span>
							</div>
							<br />
							<input type="submit" name="addCustomer" id="addCustomer" onClick="return checksub();" value=" 确 定 " />
						</form>
						<div class="clear"></div>
					</div>
				</div>
			</div>
		</div>
		<br>
	</body>

</html>